package cn.iocoder.yudao.module.reading.dal.mysql.community;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.reading.dal.dataobject.community.CommunityReportDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 社区举报 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CommunityReportMapper extends BaseMapperX<CommunityReportDO> {

    /**
     * 查询用户对指定目标的举报记录
     */
    default CommunityReportDO selectByReporterAndTarget(Long reporterId, String targetType, Long targetId) {
        return selectOne(CommunityReportDO::getReporterId, reporterId,
                        CommunityReportDO::getTargetType, targetType,
                        CommunityReportDO::getTargetId, targetId);
    }

}
